package router_group

import akka.routing.ConsistentHashingRouter.ConsistentHashable

/**
 * @Description: Router-Group 分组路由必须实现Serializable
 * @Author: DJJ
 * @Date: 2019/12/16 10:31
 */

object Messages {
  class MathOps(hashKey: String) extends Serializable with ConsistentHashable {
    override def consistentHashKey: Any = hashKey
  }
  case class Add(x: Int, y: Int) extends MathOps("adder")
  case class Sub(x: Int, y: Int) extends MathOps("substractor")
  case class Mul(x: Int, y: Int) extends MathOps("multiplier")
  case class Div(x: Int, y: Int) extends MathOps("divider")

}

